<?php
/**
 * v3.1 消消乐游戏改版
 *
 * Author: Zeon
 * Date: 2018/3/23
 * Created by Panxsoft.
 */

use Illuminate\Support\Facades\Route;

/** H5（无需微信网页授权） */
Route::group([
    'prefix' => 'v3-1',
    'namespace' => 'V3_1'
], function () {
    /**
     * App（Pad）游戏中扫码转到手机（公众号）玩游戏
     *
     * @see \App\Http\Controllers\Wechat\V3_1\BoomGameController::playQrCode()
     */
    Route::get('/boom-game/play-qr-code', 'BoomGameController@playQrCode')
        ->name(\App\Http\Controllers\Wechat\V3_1\BoomGameController::ROUTES['playQrCode']);

    /**
     * App（Pad）游戏完成扫码转到手机（公众号）卡包
     *
     * @see \App\Http\Controllers\Wechat\V3_1\BoomGameController::couponQrCode()
     */
    Route::get('/boom-game/coupon-qr-code', 'BoomGameController@couponQrCode')
        ->name(\App\Http\Controllers\Wechat\V3_1\BoomGameController::ROUTES['couponQrCode']);

    /**
     * 优惠券抽奖
     *
     * @see \App\Http\Controllers\Wechat\V3_1\CouponTicketController::lottery
     */
    Route::get('/coupon-ticket-lottery', 'CouponTicketController@lottery')
        ->name(\App\Http\Controllers\Wechat\V3_1\CouponTicketController::ROUTES['lottery']);

    /**
     * 优惠券列表
     *
     * @see \App\Http\Controllers\Wechat\V3_1\CouponTicketController::index
     */
    Route::get('/coupon-ticket', 'CouponTicketController@index')
        ->name(\App\Http\Controllers\Wechat\V3_1\CouponTicketController::ROUTES['index']);
});


Route::group([
    'middleware' => 'WechatAuth',
    'prefix' => 'v3-1',
    'namespace' => 'V3_1'
], function () {
    /**
     * 优惠券管理逻辑
     *
     * @see \App\Http\Controllers\Wechat\V3_1\CouponCardController
     */
    Route::resource('/coupon-card', 'CouponCardController')
        ->names(\App\Http\Controllers\Wechat\V3_1\CouponCardController::ROUTES);
});
